package com.lean.ssm.chapter2.reflect;

import java.lang.reflect.Method;

public class main {
    public static void main(String []args) {
        test1 object = null;
        try {
            object = (test1)
                    Class.forName("com.lean.ssm.chapter2.reflect.test1").newInstance();
            Method m=object.getClass().getMethod("sayHello", String.class);
            m.invoke(object,"迪第");
        }
           catch(Exception ex)//
           {
               ex.printStackTrace();//sad as
           }
    }
}
